<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2023/6/9 0009
  Time: 17:07
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <title>班级操作</title>
</head>
<body>

<c:choose>
    <c:when test="${requestScope.tag==1}"><h1>班级修改</h1></c:when>
    <c:otherwise><h1>班级添加</h1></c:otherwise>
</c:choose>


<a href="ClassRoomViewController.action">返回</a>
<hr>
<!--
   form表单使用action属性表示你需要请求哪个url
   form表单使用method属性表示是get请求还是post请求
   form表单里面如果有submit按钮，则直接点击按钮立即请求
   -->

<c:choose>
<c:when test="${requestScope.tag==1}">
<form action="ClassRoomController.action?option=edit" method="post"></c:when>
    <c:otherwise>
    <form action="ClassRoomController.action?option=add" method="post"></c:otherwise>
        </c:choose>


        <input type="hidden" name="id" value="${requestScope.classRoom.id}">

        <div><label>班级名称：</label><input type="text" name="name" value="${requestScope.classRoom.name}"></div>


        <c:choose>
            <c:when test="${requestScope.tag==1}">
                <button type="submit">修改</button>
            </c:when>
            <c:otherwise>
                <button type="submit">添加</button>
            </c:otherwise>
        </c:choose>


    </form>
</body>
</html>
